package com.woniuxy.controller;


import com.woniuxy.controller.form.GetGoodsAppLogForm;
import com.woniuxy.controller.form.SaveGoodsAppraiseLogForm;
import com.woniuxy.service.PawnGoodsAppraiseLogService;
import com.woniuxy.utils.Result;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author hujianying
 * @since 2022-03-23
 */
@RestController
@RequestMapping("/pawnGoodsAppraiseLog")
@Api(tags = "评估相关接口")
public class PawnGoodsAppraiseLogController {

    @Resource
    private PawnGoodsAppraiseLogService pgals;


    /**
     * 根据商品id查询历史评估记录
     * @param ggalf goodsCode
     * @return GoodsAppLogInfo
     */
    @ApiOperation("根据商品id查询历史评估记录")
    @GetMapping("/getGoodsAppraiseLogByGoodsId")
    public Result getGoodsAppraiseLogByGoodsId(GetGoodsAppLogForm ggalf){
        return pgals.getGoodsAppraiseLogByGoodsId(ggalf);
    }

    /**
     * 新建评估
     * @param sgalf SaveGoodsAppraiseLogForm
     * @return data为null
     */
    @ApiOperation("新建评估")
    @PostMapping("/saveGoodsAppraiseLog")
    public Result saveGoodsAppraiseLog(@RequestBody SaveGoodsAppraiseLogForm sgalf){
        return pgals.saveGoodsAppraiseLog(sgalf);
    }
}

